# Maintainer: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jacek Poplawski <jacekpoplawski@gmail.com>

pkgname=rocksndiamonds
pkgver=4.3.7.1
pkgrel=1
pkgdesc="game similiar to Boulderdash with lots of levels"
arch=(loong64 x86_64)
url="https://www.artsoft.org/rocksndiamonds/"
license=('GPL')
depends=('sdl2' 'sdl2_image' 'sdl2_mixer' 'sdl2_net')
source=(https://www.artsoft.org/RELEASES/linux/rocksndiamonds/rocksndiamonds-$pkgver-linux.tar.gz
	rocksndiamonds.desktop)
sha256sums=('800cc3d76f5a372d9c1d54dc305a3c80c820274eb97f502ae8a4d7602422df37'
            'f92b604abeeda66aa28d06ae2d8b0ea89aedfd7686d3f8c73d8c0b05ad039439')

build() {
  cd "$srcdir"/rocksndiamonds-$pkgver
  make clean
  make BASE_PATH=/usr/share/rocksndiamonds
}

package() {
  depends+=('rocksndiamonds-data')
  optdepends+=('rocksndiamonds-contrib')

  cd "$srcdir"/rocksndiamonds-$pkgver

  install -d "$pkgdir"/usr/bin
  cp "$srcdir"/rocksndiamonds-$pkgver/rocksndiamonds "$pkgdir"/usr/bin/rocksndiamonds

#  install -d "$pkgdir"/usr/share/man/man1
#  cp "$srcdir"/rocksndiamonds-$pkgver/rocksndiamonds.1 "$pkgdir"/usr/share/man/man1

  install -d "$pkgdir"/usr/share/doc/$pkgname/
  cp -a docs/elements "$pkgdir"/usr/share/doc/$pkgname/

  install -Dm0644 build-projects/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png "$pkgdir"/usr/share/pixmaps/$pkgname.png
  install -Dm0644 "$srcdir"/rocksndiamonds.desktop "$pkgdir"/usr/share/applications/rocksndiamonds.desktop
}
